package com.chatroom.client.model;

/**
 * Represents a single message in the chat.
 * This class is a data container (Model/DTO) for message information.
 */
public class Message {

    private final String content; // The text content of the message
    private final String sender; // The username of the person who sent it
    private final boolean fromSelf; // True if this message was sent by the current user

    /**
     * Constructs a new Message object.
     *
     * @param content  The textual content of the message.
     * @param sender   The username of the sender.
     * @param fromSelf True if this is an outgoing message, false otherwise.
     */
    public Message(String content, String sender, boolean fromSelf) {
        this.content = content;
        this.sender = sender;
        this.fromSelf = fromSelf;
    }

    // --- Getters ---

    public String getContent() {
        return content;
    }

    public String getSender() {
        return sender;
    }

    public boolean isFromSelf() {
        return fromSelf;
    }
}
